// 主页接口
import request from "@/request";

 // 获取币种
export const _getCoins = () => {
    return request({
        url: "/api/item!list.action",
        method: "post",
        // isLoading: true
    })
};

// 获取行情
export const _getHomeList = (symbol) => {
    return request({
        url: "/api/hobi!getRealtime.action",
        method: "post",
        // params: {
        //     symbol
        // }
        data:{
            symbol:symbol
        },
        isDecrypt:1,
        // isLoading: true
    })
};

// 汇率
export const _getExchangeRate = (symbol) => {
    return request({
        url: "/api/exchangerateuserconfig!get.action",
        method: "post",
        data: {
            symbol
        }
        // isLoading: true
    })
};

// 查询是否加入自选
export const _checkIsInCollect = symbol => {
    return request({
        url: '/api/itemUserOptional!getItemOptionalStatus.action',
        method:'post',
        data: {
            symbol
        }
    })
}

// 自选
export const _collect = (symbol) => {
    return request({
        url: '/api/itemUserOptional!add.action',
        method: 'post',
        loading: true,
        data: {
            symbol
        }
    })
}

// 删除自选
export const _deleteCollect = symbol => {
    return request({
        url: '/api/itemUserOptional!delete.action',
        method: 'post',
        loading: true,
        data: {
            symbol
        }
    })
}

// 我的自选
export const _myCoins = () => {
    return request({
        url: '/api/itemUserOptional!list.action',
        method: 'post'
    })
}